#pragma once

#include <boost/shared_ptr.hpp>

#include "exports.hpp"
#include "Flags.hpp"




namespace db
{
	class DB_SCHEMA_API Attribute
	{
	public:

		enum Type
		{
			Unknown,
			Char,
			Byte,
			Short,
			Integer,
			Long,
			Float,
			Double,
			String,
			Blob,
			ByteArray,
			Boolean,
		};

		typedef boost::shared_ptr<Attribute>         Ptr;
		typedef boost::shared_ptr<const Attribute>   const_Ptr;

	public:

		Attribute();
		virtual ~Attribute();



		/**
		 * @returns the name of this attribute
		 */
		virtual QString name() const = 0;

		/**
		 * @returns the type of this attribute
		 */
		virtual Type type() const = 0;

		/**
		 * @returns the flags of this attribute
		 */
		virtual Flags flags() const = 0;

		/**
		 * @returns the size of this attribute (for strings, etc...)
		 */
		virtual std::size_t size() const = 0;



		/**
		 * @returns string representation of the given type.
		 */
		static QString name(Type type);
	};
	///////////////////////////////////////////////////////////////////////////////////////////////
}
///////////////////////////////////////////////////////////////////////////////////////////////////
